<?php

class Error 
{
    public static function catchException(Exception $exception) 
    {

        $error = $exception->getMessage();
        $trace = $exception->getTraceAsString();
        $str = 'ERROR: '. $error . "\n" . $trace;
        $conf = Zend_Registry::get('config');
        if($conf->etrace) {            
            Zend_Debug::dump($str); 
        } 
        else {
            die();
        }
    }
}